﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;

namespace Koeltp.DataAccess
{
    /// <summary>
    ///IDataAccessFactory 的摘要说明
    /// </summary>
    public class IDataAccessFactory
    {
        public static IDataAccess CreateDataAccess()
        {
            string connStr = ConfigurationManager.ConnectionStrings["connStr"].ToString(); //读取连接字符串
            string connType = ConfigurationManager.ConnectionStrings["connType"].ToString(); //读取连接数据库的类型
            switch (connType)
            {
                case "MSSQL":
                    return new MSSQLDAL(connStr);
                //case "ORACLE":
                //    return new ORACLEDAL(connStr);
                //    break;
                default:
                    throw new Exception("现在暂时不支持此数据库！！！");
            }
        }
    }
}